package com.ny605;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.SQLException;

public class TestConnection {
    private  final static  String URL = "jdbc:mysql://localhost:3306/pdd";
    private final  static String ROOT = "root";
    private  final  static  String PASSWORD = "123456";
    Connection connection = DriverManager.getConnection(URL,ROOT,PASSWORD);
    String sql ="insert into users(username,password) values(1,1)";
    PreparedStatement preparedStatement = connection.prepareStatement(sql);
    int i = preparedStatement.executeUpdate();
    if(i>0){
        System.out.println("注册成功");
    }

    public TestConnection() throws SQLException {
    }
}
